Kinetis SDK API Reference Manual  1.0.0-beta
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
I2C Slave peripheral driver

The section describes the programming interface of the I2C slave mode Peripheral driver. More...

Data Structures

struct  i2c_slave_user_config_t
 brief Definition of application-implemented callback functions used by the I2C slave driver. More...
 

I2C Slave

void i2c_slave_init (uint32_t instance, i2c_slave_user_config_t *appInfo)
 Initializes the I2C module. More...
 
void i2c_slave_shutdown (uint32_t instance)
 Shuts down the I2C slave driver. More...
 

Data Structure Documentation

struct i2c_slave_user_config_t

Data Fields

i2c_status_t(* data_source )(uint8_t *source_byte)
 Callback to get byte to transmit. More...
 
i2c_status_t(* data_sink )(uint8_t sink_byte)
 Callback to put received byte. More...
 
void(* on_error )(i2c_status_t error)
 Callback to report an I2C error. More...
 
uint8_t slaveAddress
 7-bit slave address. More...
 

Field Documentation

i2c_status_t(* i2c_slave_user_config_t::data_source)(uint8_t *source_byte)
i2c_status_t(* i2c_slave_user_config_t::data_sink)(uint8_t sink_byte)
void(* i2c_slave_user_config_t::on_error)(i2c_status_t error)
uint8_t i2c_slave_user_config_t::slaveAddress

Function Documentation

void i2c_slave_init ( uint32_t  instance,
i2c_slave_user_config_t appInfo 
)

Saves the application callback info, turns on the clock to the module, enables the device, and enables interrupts. Sets the I2C to slave mode. IOMux is expected to be already handled in the init_hardware().

Parameters
instanceInstance number of the I2C module.
appInfoPointer of the application information.
void i2c_slave_shutdown ( uint32_t  instance)

Clears the control register and turns off the clock to the module.

Parameters
instanceInstance number of the I2C module.